<%@ page contentType="text/html;charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@page import="com.ufida.ebscg.comm.session.UserBean"%>
<%@page import="com.ufida.ebscg.portal.web.action.ProdUnitTool" %>
<%@page import="nc.vo.bd.invdoc.MeasdocVO" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>产品单位选择</title>
</head>
<body>

<%
	ProdUnitTool put = new ProdUnitTool();
	MeasdocVO[] mdvos = put.getMeasVOS();
	int length = mdvos.length;
%>


		<%
			for(int index=0; index<length; index++){
				MeasdocVO mvo = mdvos[index];
		%>
        <div style="width:100%;height:26px; font-size:12px; border-color:blue; border-bottom-style:solid; border-bottom-width:0.5pt;" 
        
        id='<%=mvo.getPrimaryKey() %>'  ondblclick="dealXuanZhongMsg(this);"  
        
        onclick="divOnClick(this);"   onmouseout="divOut(this);" onmouseover="divIn(this)" style="cursor:hand" align="center"

            value = '<%=mvo.getMeasname() %>'
        >
        	<%=mvo.getMeasname() %>
        </div>
        
       
       <%} %>
       
        <div style='width:100%' align='center'>
   			<input type='button' value='确  定' id='close_button' style='display:inline;height:20px' onclick='btnOk()' />
   			<input type='button' value='取  消' id='cancel_button' style='display:inline;height:20px' onclick='btnCancel()' />
   		</div>
   

 
 <script language="javascript">

 	var divObj = null;
 	function dealXuanZhongMsg(obj){

 	 	if(obj != null){
 			window.returnValue  = obj.id + ";"+obj.value;
 	 	}
 		window.close();
 	}

 	function btnCancel(){
 		window.returnValue = null;
 		window.close();
 	}

 	function btnOk(){
 		dealXuanZhongMsg(divObj);
 	}
 	
 	function divOnClick(obj){

 			if(divObj != null){
 				divObj.style.background = "white";
 			}
 			divObj = obj;
 			obj.style.background = "red";
 	 	
 	}

 	function divIn(obj){
 		obj.style.background= "green";
 	}

 	function divOut(obj){
 	 	if(obj == divObj){
 			obj.style.background = "red";
 	 	}else{
 	 		obj.style.background = "white";
 	 	}
 	}

 </script>
 </body>
 </html>